package com.yuexun.dhdoctor.module.departmentDocumentNew;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;


import com.yuexun.dhdoctor.R;
import com.yuexun.dhdoctor.base.BaseKJActivity;
import com.yuexun.dhdoctor.module.departmentDocumentNew.fragment.Frag_Doc_Common_New;
import com.yuexun.dhdoctor.module.departmentDocumentNew.fragment.Frag_Doc_Department_New;
import com.yuexun.dhdoctor.module.departmentDocumentNew.fragment.Frag_Doc_My_Share_New;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by Administrator on 2018/11/28 0028.
 */

public class Act_Document_New_New extends BaseKJActivity {
    @Bind(R.id.rl_doc_department)
    RelativeLayout btnDepartment;
    @Bind(R.id.tv_doc_department)
    TextView tvDepartment;
    @Bind(R.id.img_doc_department)
    ImageView imgDepartment;

    @Bind(R.id.rl_doc_common)
    RelativeLayout btnCommon;
    @Bind(R.id.tv_doc_common)
    TextView tvCommon;
    @Bind(R.id.img_doc_common)
    ImageView imgCommon;

    @Bind(R.id.rl_doc_my)
    RelativeLayout btnMy;
    @Bind(R.id.tv_doc_my)
    TextView tvMy;
    @Bind(R.id.img_doc_my)
    ImageView imgMy;

    private Frag_Doc_Department_New frag_doc_department_new;
    private Frag_Doc_Common_New frag_doc_common_new;
    private Frag_Doc_My_Share_New frag_doc_my_share_new;

    @Override
    public void setRootView() {
        setContentView(R.layout.act_document_new_new);
        ButterKnife.bind(this);
    }

    @Override
    public void initData() {
        super.initData();
        frag_doc_department_new = new Frag_Doc_Department_New();
        frag_doc_common_new = new Frag_Doc_Common_New();
        frag_doc_my_share_new = new Frag_Doc_My_Share_New();
        changeFragment(R.id.framelayout_content, frag_doc_department_new);
    }

    @OnClick({R.id.back, R.id.rl_doc_department, R.id.rl_doc_common, R.id.rl_doc_my})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.back:
                finish();
                break;
            case R.id.rl_doc_department:
                tvDepartment.setTextColor(getResources().getColor(R.color.doc_advice_01));
                imgDepartment.setBackgroundColor(getResources().getColor(R.color.doc_advice_01));
                tvCommon.setTextColor(getResources().getColor(R.color.doc_advice_03));
                imgCommon.setBackgroundColor(getResources().getColor(R.color.doc_advice_05));
                tvMy.setTextColor(getResources().getColor(R.color.doc_advice_03));
                imgMy.setBackgroundColor(getResources().getColor(R.color.doc_advice_05));
//                type = 0;
//                setDownOrNorm(false, type);
                changeFragment(R.id.framelayout_content, frag_doc_department_new);
                break;
            case R.id.rl_doc_common:
                tvDepartment.setTextColor(getResources().getColor(R.color.doc_advice_03));
                imgDepartment.setBackgroundColor(getResources().getColor(R.color.doc_advice_05));
                tvCommon.setTextColor(getResources().getColor(R.color.doc_advice_01));
                imgCommon.setBackgroundColor(getResources().getColor(R.color.doc_advice_01));
                tvMy.setTextColor(getResources().getColor(R.color.doc_advice_03));
                imgMy.setBackgroundColor(getResources().getColor(R.color.doc_advice_05));
//                type = 1;
//                setDownOrNorm(false, type);
                changeFragment(R.id.framelayout_content, frag_doc_common_new);
                break;
            case R.id.rl_doc_my:
                tvDepartment.setTextColor(getResources().getColor(R.color.doc_advice_03));
                imgDepartment.setBackgroundColor(getResources().getColor(R.color.doc_advice_05));
                tvCommon.setTextColor(getResources().getColor(R.color.doc_advice_03));
                imgCommon.setBackgroundColor(getResources().getColor(R.color.doc_advice_05));
                tvMy.setTextColor(getResources().getColor(R.color.doc_advice_01));
                imgMy.setBackgroundColor(getResources().getColor(R.color.doc_advice_01));
//                type = 2;
//                setDownOrNorm(false, type);
                changeFragment(R.id.framelayout_content, frag_doc_my_share_new);
                break;
        }
    }
}
